package cn.jobstart.controller;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RequestMapping;
import javax.annotation.Resource;
import org.springframework.web.bind.annotation.RestController;
import cn.jobstart.pubInter.exception.SkException;
import cn.jobstart.pubInter.IBaseService;
import cn.jobstart.pubInter.RestfulController;
import cn.jobstart.dto.SchoolDTO;
import cn.jobstart.dto.SchoolPageDTO;
import cn.jobstart.modelExt.SchoolExt;
import cn.jobstart.searchExt.SchoolSearchExt;
import cn.jobstart.service.ISchoolService;
import cn.jobstart.vo.SchoolDetailVO;
import cn.jobstart.vo.SchoolListVO;
import cn.jobstart.vo.SchoolDomainVO;
import cn.jobstart.vo.SchoolDetailDomainVO;
import cn.jobstart.export.SchoolDomainExport;
import cn.jobstart.controller.ApiManageController;
import org.springframework.validation.annotation.Validated;
import java.util.Set;
import java.util.HashSet;
import cn.jobstart.pubInter.exception.BusinessException;

/**
*    @author sunke
*    @Date 2023-11-08 20:27:26
*    @description SchoolController      学校
*/
@Api(tags = "后台管理系统-学校相关", description = "学校相关接口")
@RestController(value ="schoolRestfulController")
@RequestMapping("/school/")
@Validated
public class SchoolController extends ApiManageController<SchoolDTO,SchoolPageDTO,SchoolExt, SchoolSearchExt,SchoolDomainVO,SchoolDetailDomainVO,SchoolDetailVO,SchoolListVO,String> {

	@Resource(name = "schoolService")
	private ISchoolService schoolService;



	@Override
	public IBaseService<SchoolExt, SchoolSearchExt,String> getBaseService() throws SkException {
		return schoolService;
	}

	@Override
	public String getBaseRoute() {
		return "/school/";
	}

	/**
	* 当前模板名称
	* @return
	*/
	@Override
	public String getModelName(){
		return "学校";
	}

	@Override
	public Class exportExcelClass() {
		return SchoolDomainExport.class;
	}

	@Override
	public Set<String> totalMapSet() {
		Set totalMapSet=new HashSet();
		totalMapSet.add("count(school.s_id) as countNum");

		return totalMapSet;
	}


}